diff --git a/CMakeLists.txt b/CMakeLists.txt index d208e3a..d8ddafd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,6 @@ project(Genetics) cmake_minimum_required(VERSION 2.8) -include_directories("${PROJECT_SOURCE_DIR}/include/") add_definitions(-std=c++1y) find_package(Boost REQUIRED COMPONENTS filesystem program_options serialization system) @@ -9,6 +8,5 @@ include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) set(libs ${libs} ${Boost_LIBRARIES}) set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) -add_subdirectory("include") add_subdirectory("lib") add_subdirectory("src") diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt deleted file mode 100644 index 987fe23..0000000 --- a/include/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ - -# Hack to show headers in Qt Creator -file(GLOB headers "*.hpp") -add_library(dummy ${headers} dummy.cpp) diff --git a/include/dummy.cpp b/include/dummy.cpp deleted file mode 100644 index 7dcf12c..0000000 --- a/include/dummy.cpp +++ /dev/null @@ -1,2 +0,0 @@ -// Needed for the hack to show headers in Qt Creator -static int x = x; diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 6196f11..531ed1b 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,4 +1,6 @@ file(GLOB sources "*.cpp") -add_library(common STATIC ${sources}) +file(GLOB headers "*.hpp") +add_library(common ${headers} ${sources}) target_link_libraries(common ${libs}) +target_include_directories(common INTERFACE ".") diff --git a/include/evolve.hpp b/lib/evolve.hpp similarity index 100% rename from include/evolve.hpp rename to lib/evolve.hpp diff --git a/include/genome.hpp b/lib/genome.hpp similarity index 99% rename from include/genome.hpp rename to lib/genome.hpp index 254d33e..f37240e 100644 --- a/include/genome.hpp +++ b/lib/genome.hpp @@ -19,6 +19,7 @@ struct Gen { kAdd, kSub, kMult, + kMod, kDiv, kPow, kTypes diff --git a/include/utilities.hpp b/lib/utilities.hpp similarity index 85% rename from include/utilities.hpp rename to lib/utilities.hpp index eedfc0e..7b8bf97 100644 --- a/include/utilities.hpp +++ b/lib/utilities.hpp @@ -2,6 +2,7 @@ // I needed a safe division in order to avoid SIGFPE int divi(int x, int y); +int modi(int x, int y); // Integer power function int powi(int base, int exp);